#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;

typedef long long ll;

ll pow(ll a, ll n, ll p)    //快速幂 a^n % p
{
    ll ans = 1;
    while(n)
    {
        if(n & 1) ans = (ans * a) % p;
        a = ((a%p) * (a%p)) % p;
        n >>= 1;
    }
    return ans;
}

ll niyuan(ll a, ll p)   //费马小定理求逆元
{
    return pow(a, p - 2, p);
}


ll fun(ll a, ll b){
    if(b==0)
        return a;
    else
        return fun(b, a%b);
}//迭代函数

int main()
{
    ll x=1, y=1;
    int n=32;
    ll ax;
    //while(n<100){
    {
        ll k;
        y=2*n*(2*n+1);
        if(n>1){
            y=y*(n+1);
            x=x*n;

            k=n+2;
            while(k<2*n){
                y=y*k;
                x*=(2*n+1-k);

                ax=fun(x,y);
                if(ax!=0){
                    x/=ax;
                    y/=ax;
                }

                k++;
            }
        }
        ax=fun(x,y);
        if(ax!=0){
            x/=ax;
            y/=ax;
        }
        cout << "n=" << n << endl;
        cout << "化简后分子为:" << x << endl;
        cout << "化简后分母为:" << y << endl;
        ll a=y, p=998244353;
        ll result = niyuan(y,p);
        cout << "逆元是" << result << endl;
        result *=x;
        cout << "结果是" << result << endl;

        n++;
    }
    return 0;
}
